package com.dsz.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@Entity
@Table(name="t_users")
@GenericGenerator(name="sys-uuid",strategy="uuid")
public class Users {

	@Id
	@GeneratedValue(generator="sys-uuid")
	private String uid; //用户编号  UUID
	private String loginname;
	private String password;
	private String lslockout;
	private String lasttime;
	private String creattime;
	private Integer psdwrongtime;
	private String locktime;
	private String cardnO;
	private String protectemail;
	private String protectmtel;
	
	@ManyToMany(fetch=FetchType.LAZY,mappedBy="us")
	@JsonIgnoreProperties("us")
	private Set<Roles> rs = new HashSet<>();

	public Users(String uid, String loginname, String password, String lslockout, String lasttime, String creattime,
			Integer psdwrongtime, String locktime, String protectemail, String protectmtel) {
		this.uid = uid;
		this.loginname = loginname;
		this.password = password;
		this.lslockout = lslockout;
		this.lasttime = lasttime;
		this.creattime = creattime;
		this.psdwrongtime = psdwrongtime;
		this.locktime = locktime;
		this.protectemail = protectemail;
		this.protectmtel = protectmtel;
	}

	public Users() {
	}

	public String getUid() {
		return uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	public String getLoginname() {
		return loginname;
	}

	public void setLoginname(String loginname) {
		this.loginname = loginname;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getLslockout() {
		return lslockout;
	}

	public void setLslockout(String lslockout) {
		this.lslockout = lslockout;
	}

	public String getLasttime() {
		return lasttime;
	}

	public void setLasttime(String lasttime) {
		this.lasttime = lasttime;
	}

	public String getCreattime() {
		return creattime;
	}

	public void setCreattime(String creattime) {
		this.creattime = creattime;
	}

	public Integer getPsdwrongtime() {
		return psdwrongtime;
	}

	public void setPsdwrongtime(Integer psdwrongtime) {
		this.psdwrongtime = psdwrongtime;
	}

	public String getLocktime() {
		return locktime;
	}

	public void setLocktime(String locktime) {
		this.locktime = locktime;
	}

	public String getProtectemail() {
		return protectemail;
	}

	public void setProtectemail(String protectemail) {
		this.protectemail = protectemail;
	}

	public String getProtectmtel() {
		return protectmtel;
	}

	public void setProtectmtel(String protectmtel) {
		this.protectmtel = protectmtel;
	}

	public Set<Roles> getRs() {
		return rs;
	}

	public void setRs(Set<Roles> rs) {
		this.rs = rs;
	}

	@Override
	public String toString() {
		return "Users [uid=" + uid + ", loginname=" + loginname + ", password=" + password + ", lslockout=" + lslockout
				+ ", lasttime=" + lasttime + ", creattime=" + creattime + ", psdwrongtime=" + psdwrongtime
				+ ", locktime=" + locktime + ", protectemail=" + protectemail + ", protectmtel=" + protectmtel + ", rs="
				+ rs + "]";
	}

	
	
	
	
	
}













